package cn.iocoder.yudao.module.leverage.enums;

import cn.hutool.core.util.EnumUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

@Getter
@AllArgsConstructor

public enum TypeEnum {
    FREE(1, "免息(天)"),
    DAY(2, "日"),
    WEEK(3, "周"),
    MONTH(4, "月");

    private final Integer type;

    private final String title;

    public static TypeEnum getByType(Integer type) {
        return EnumUtil.getBy(TypeEnum.class,
                e -> Objects.equals(type, e.getType()));
    }
}
